import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  Req,
  Res,
  Query,
} from '@nestjs/common';
import { MenuService } from './menu.service';

@Controller({ path: 'menus', version: '1' })
export class MenuController {
  constructor(private readonly menuService: MenuService) {}
  @Get('options')
  getOptions(@Req() req: any) {
    return this.menuService.getOptions();
  }
  @Post('add')
  create(@Body() createMenuDto: any) {
    console.log(createMenuDto);

    return this.menuService.addMenu(createMenuDto);
  }
  @Post('update')
  update(@Body() updateMenuDto: any) {
    return this.menuService.updateMenu(updateMenuDto);
  }

  @Delete('delete/:id')
  remove(@Param('id') id: string) {
    return this.menuService.removeMenu(id);
  }
  @Get('list')
  getMenuList() {
    return this.menuService.getMenuList();
  }
}
